package com.hmdp.config;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

import com.hmdp.dto.Result;

import lombok.extern.slf4j.Slf4j;

/**
 * 通用异常处理
 * 
 * @author 17452
 *
 */
@Slf4j
@RestControllerAdvice
public class WebExceptionAdvice {

	@ExceptionHandler(RuntimeException.class)
	public Result handleRuntimeException(RuntimeException e) {
		log.error(e.toString(), e);
		return Result.fail("服务器异常");
	}
}
